Web: Refactored a lot of this