big refactor and also starting to think about #21