code refactoring again