Cleaned up the 'resolve from classpath or file' logic