refactoring init