refactore: rename function to be more readable and use String#slice