Extract gain into module