clean up code

- remove unused html
- tidy up comments
- simplify input.type method

Thanks @jarmo for feedback!