moving code in lib directory