removed obsolete and unused code, reviewed and added comments, renamed some classes