Refactor & cleanup