code clean up, removed unused variables and debug logs Refs item:387