Refactor
Add before_filter
Add debug page