Remove unncessary definitions and format codes