re-factory and add resource files