Removed duplication of calling smallest-prime by using let