Modified controller module to be more idiomatic