Cleaning up the constructor function