some optimizations ...