Split build and deploy, move to lib folder