little code refactoring... I just discovered functions, OMG!