avoid using external commands for speed