Extract fns
Add test
Simplify
Add todo
Extract heroku database_url parsing