Locallayer first update. Maybe we can move this code to sandbox.