refactoring code check