attempt at a cleaner API
some constness added, need validation