- fixed some isues with clean urls
- made the code less redundant