Refactor gui setup + adding some code.