Performed minor refactoring