be more idiomatic, remove unneeded hacks, imports