refactored constructor0