cleaned up the spinner code