Moved deploy funciton into lib dir