Split code into modules
Add safely remove binary
Refactor javascript in HTML template