and some more code cleanup
minor edits