tried out some optimizations