Refactor & modernize