simplify api and make detection more robust