Clean up the code in the constructor