refactoring / fixing compiler warnings