style polishing, minor code cleanup