refactor & remove unused code