code improvements, comments and others