Code is less limited and makes sense and redundant code is removed

Signed-off-by: Ollie <dzineit@live.co.uk>