Finally got rid of all compiler's warnings, cleaned up code here and there and added some TODOs