rename variables; remove unused code