Did some fixes and removed some unused imports, duplicated methods and debug messages.