moved common code to the library