Improved input class to use struct