refactor of pmtrs working