first prototype refactoring