Reorganization + revision of API