Add gravity well definition and refactor