only load the user once
refactorings

use flash.notice and flash.alert instead of hash syntax
use flash.alert instead of flash[:error]