Framework for managing entities