Reformatted using IntelliJ's default settings (+rearrange)