Refactor the create button macro to deal with dialog and acl