cleaned the base code