Moving some jQuery to a better place