restructuring webapp