work in progress. in search of better api