fix for [] and minor refactoring