Mass refactor of frontend organisation