re-arranging build script for logical order