model loader: remove dead code and unused code