clean the master by nico's code