remove bin and refactor