Compress DRY code