refactoring arrays
refactoring with singleton