Tidying up button code.