Restructured API a little