some simplifications and better us of the available APIs