broke things down into smaller methods