Add comments, reduced duplicated code and automatic concrete class instantation by file extension