make logic clearer