refactors bin