huge refactor to data compiler