used extend for less code duplication