Refactoring web tier