refactoring paul's code