updated formating, extracted methods