Pulled variables to one place, made errors work nicer