WIP: Code cleanup