better exceptions + a few adjustments