first refactor from django-geckoboard