refactored to use the from api