Edited for brevity