cleanup and change palette type