Remove majority of code for a fresh rewrite