Code improvements after github review