Code simplified