createResource() method was moved top of source file