Spinner style code refactoring