[WIP] removed unused variables and dead code