Refactor some smelly code
Latest changes before reader/writer impl
More reader implementation