move plan to external factory and all classes redefined to public