Refactor, minor code quality improvement