cleaning up the code, some logic was moved too alcarin api