refactor & cleanup