code refactoring, use defaults object