Code simplyfied