some optimizations
resolve conflict