Small Code refactoring