change attributes manipulation function to be more general