Convert code to use attributes instead of attar