little code improvement and kill warnings