initial refactoring