refactored weight and bias intialization