Refactor grabstat django application