refactoring in creation functions