Refactor register and build data