Build logic is refactored