Separate out control logic