Move extension functions to separate package