Few minor code improvements