refactor: replaced old fragment code with idiomatic versions