Clean up code in ApplicationController