Bg/refactor