What are types `1` and `7`, and is it possible to write this without resorting to magic numbers?