Code improvements

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>