simplifying code, rename variables and methods and indenting classes