Move statement type checking into separate module