added custom directive for spinner, minor refactoring