more refactoring and removing spaces