Refactored PSMC model and fixed a few interface bugs