split into lib and apps