working on loader animation functionality and doing some refactoring