Moved form button generation into own method. Reduced doButton() in size.