Small code refactoring