minor refactoring to improve the readability