Refactor, use moar packages, fix raw sql stuff.