change constructors and functions definitions