Finalise the application. Remove some variable that not been used.