code clean up template