move common files to lib