Huge revamp on how the code work.

Signed-off-by: crynobone <crynobone@gmail.com>