made code re-usable