Move some code in constructor