adding javadocs, decoupling methods, changing some of the messages.