more refactoring
more cleanups