Rewrite: Small refactoring