Core entities and some code