Built function code refactored