Reformatted code using AppCode