Code clean up + comments