Some constuctor changes and unit testing