prototype refactoring