Only compile functions when necessary