minor code improvements
refactoring