refactor & remove debugging