clean up this code