refactoring: add final class, remove redundant code, etc.