function for creating decorator objects