re-arrange to make re-usable executable