consolidate codes that deal with resolving paths to one source file