BSA refactoring and better organisation.