optimized a little