I noticed you use the strings "simple" and "immediate" in many places. You should make them constants.