Little code refactoring