Abstracted the constructor with parameters