[WIP] review changes and some attempted simplification
Doesnt work locally, but does it work on travis?