Added entity rollbacks + code cleanup