simplify loader logic