changing low level api to make it more flexible for higher level api development