Cleaned up some code wrt creating new entities