Little optimizations

- Parse instead of building at startup
- Replaced a function call by a litteral value
- Use the same code to detect file extension