minor code optimizations through code inspector