Overhauled code, extracted methods