Integration tests passing. WIP Refactor