refactored, untested
Merge branch 'master' of github.com:scopatz/fief