Clean code
Better error handling, and move some code to a fake database