Clean up compositor codes

Related: #1351.