Rename variables and seperate 'main' function files