improve build script not to rebuild things that arent needed