[API] Refractor Code

some new functions to structurize the code!