did most of the problems with exception of the last 4, refactoring is needed badly!