Cleaned codebase, events/indexes written in blocks