Add new entities and improve code