general API & code improvments