Refactored unrequierd code