refactor morph and tune random forest parameters