Revamp buildscripts