clean up entry code