Type checking and redundancy removed