Slight code refactoring