Wrapping all files in correct function scope