Code improvements  + cleanup