Initial refactor of RedDec