working on #742 - code cleanup