refactor graphic module.