removing cruft
code cleanup
refactor a bit