Refactor a bit to unify types, use Weight as typealias for Float"