move hat calculations in measModel to Feature class
Use ref instead of ptr in measModel
Use cleanup method, not well tested