Seems like this should be pushed onto a thread rather than done inline?