Client gui creation code moved to its own method