Separate weight calculation from function field

Actual weight calculation should be separate from function field, this
will give provision to downstream modules to get weight in any unit.