Factor out common states