Restructure things to make them a bit simpler