Use more efficient way to get layer