Slightly refactor and improve readability