first attempt to minimise code sections