core code to carry out construction