remove unused variables, make some methods static