Refactor class auto loder