converted league model and added tests