Revamp

Very messy. Lots of duplication between this and dobi.