internal refactoring