Use mockery type function
Better loader test
Small changes