This method is very long, please splti it up. Anything more than 20 lines is suspicious.