adding private method to simplify removal logic