Code improvments