Restructure code for builder and differnt loaders on server/client