Little bit of code refactoring