Added loader fade transition and code cleanup