too long the method, more than 15 lines of code should be splitted, it contains many logic inside