cleans up the variable names and methods
merged from repo