refactoring
little optimization