entity reader + code clean up