changed to less calls to api