bin refactored