Final code optimizations for 1.0.4