Little refactor to improve code quality