clean and fix refactoring for shared resources