web: Light restructuring
web: Replace some helper functions with decorators
Small PEP8 fix