these is the same logic as the one in the constructor ... please consider refactoring