final touches - minor refactoring