code clean up
major code cleanup