Changed cell to enum type, also few improvements.