Split source code in several files for code readibility

Change-Id: I3cd58e721a69734573885449e928b52ad8562b1a