source code for resource discovery