refactor: introduce types to remove 'any' usage