optimizing from duplication code at constructors