Simplify and move loader into another package