Refactoring

 * Change the mechanism of reading the binary file
 * Adding small optimization to obtain the data

Signed-off-by: Cristian Maureira-Fredes <cmaurei@aei.mpg.de>