Refactored in order to use a plugin for general web concerns