gui next part, also refactor