Refactor, move Plan class from module device to module plan