Refactor, adding some front-end stuff