would be nice to refactor error handling and clean up code
Activity