refactor cube-related code into a factory.
update mock data.