cleanup of bugs/to-dos
minor code cleanup