Refactored (removed code which really doesn't have to be theere.)