refactor ldpm using ldpm.convert