Added resource search and code refactoring