added to_param implementation and split model related stuff into higher level module with specific sub modules