another refactoring code