cleaned up code inside keenmetric model