made refactorings on existing code