Performed minor refactorings