tidied up templates and added enter key support