optimize code for later extending