Eliminated code duplication