Refactor bad-looking types