Simplify loader and introduce variable factory