Updated to handle refs and push payloads