[BB,MR]{refactoring} cleaned up unused variables/functions, fixed other warnings, coding standard