use macro to declare constructor functions