some rearrangement
added default html handler with some best practices