refactoring main method
using type aliases
refactoring