Main class modified for testing