add resource, clean code, refactor