please split this method up into several smaller methods