Applied minor refactoring