minor refactoring: adding more spacing
minor refactoring: combining conditional blocks