create a class for each entity ;)
adjust encode