refactored now that I've taken closer clook at api doc