better solution by removing unneeded code that was already done in the constructor