Linted, moved shared functions to kbn object