Clean up code grabbing, tighten up exceptions