minor bug fix

code clean up and spreadout to their respective classes and start of
more commenting