moved easily reusable code into a shared directory