Removed debug messages and unused code