further code optimizations