Code improvements (pt2)