applying functional principles to a web application