Refactor to weighted nueral-network design