make code nicer and avoid ANR