Refactor: cache session[:user_id] in optionally assigned instance variable