Simplify some logical process