more cleainng up code and removing warnings