More GUI work, cleaning code