Refactored extension handling to separate class and fixed some documentation