code cleanup
review refactors, comments