few little changes to make code readable and to get rid of
warning messages