Integrate it all together so it's a bit less hacky