this could be modified similar to the below for backwards compatibility I think.