Some code refactoring again