clean-up

extraction function in sperate file