Reorganize frontend to have a better foundation.