Optimizations and Ruby style