Refactor file viewer classes