Migrate external commands to internal

Remove `extend self`.