mark: making it more generic