Replace coderef with subroutine