Redid code to use decorator