removed some unused variables, and grouped unused functions which happen to be used by different components