Refactored entity json loading