Removing magic numbers and rename variables