Fixes code duplication