Reordered modules and functions

Signed-off-by: Gibran Gonzalez <haibrayn@hotmail.com>