worked on functions for processing different entities