Avoid duplicate code