some changes to make it all a bit more configurable