cleanup: removed unused parameters and methods, improved scopes