Removed magical number in code and introdused variable