Properly typespec everything and make sure it passes dialyzer.