making long code short using methods