split code into multiple files

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>