Refactor further to improve readability