App source improvements; detailed error case throw/1 for clarity