Optimising initialisation codes

Too much redundancy in codes.