Use functions instead of gotos.