Better error handling, basic organization.