refactor + code clean-up