Big refactor to do rec and dev at same time