Code cleaning + fixed custom bugs thanks to avv 8)