boolean flags, code cleanup