simplify
optimized code