I actually just wanted to move the old code without thinking about improving it at all. This should maybe be the scope of another commit?