moved code into shared project