Updated functions for building stubs