Refactor the ln_s method to decrease its cyclomatic complexity