Use method to avoid duplicate code.