use type annotations and some syntactic sugar