httpHandler now has quite clean code!