Updated file io and setup layer distribution