PLA-1867 Refactor after codereview