move model loading to a separate class