Removing unused variables, make the rest static