some API rework
Buggy version