checking and refactoring