Refactor after pr reviews