remove unneeded and-or-trick
polish code