minor changes. some code cleanup