move bin logic into factory methods.