Added option to filter by file extension and few code clean ups.