Refactor hide/show and spinner animation